package java_DesignPattern.StructuralPattern.CompositePattern;

/**
 * 组合模式---测试类
 */
public class Test {

    public static void main(String[] args) {

        //创建菜单
        MenuCompoment menu = new Menu("aaa",2);
        menu.add(new MenuItem("ddd",3));
        menu.add(new MenuItem("ccc",3));

        //创建根目录
        MenuCompoment menuAll = new Menu("all", 1);
        menuAll.add(menu);

        menuAll.print();
    }
}
